
<template>
    <section class="modlude">
        <el-form :inline="true" :model="formSearch" class="form_inline" label-width="80px">
            <el-form-item label="布防状态">
                <el-select v-model="value" size='mini'>
                    <el-option label="全部" value="全部"></el-option>
                    <el-option label="部门" value="全部"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="运行状态">
                <el-select v-model="value1" size='mini'>
                    <el-option label="在线" value="在线">在线</el-option>
                    <el-option label="离线" value="离线">离线</el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="报警状态">
                <el-select v-model="value2" size='mini'>
                    <el-option label="正常" value="正常">正常</el-option>
                    <el-option label="非正常" value="非正常">非正常</el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-button size="small" @click="getList">查询</el-button>
            </el-form-item>
        </el-form>
        <div class="title" style="width:100%;background: #eee;">总共 <span style="font-size: medium;">{{number}}</span> 条
            已选中<span style="font-size: medium;">{{multipleSelection.length}}</span></div>
            <!-- @selection-change="handleSelectionChange" -->
        <el-table :data="formData" ref="multipleTable" tooltip-effect="dark" 
            style="width: 100%" stripe>
            <!-- <el-table-column type="selection" width="55"></el-table-column> -->
            <el-table-column prop="name" label="设备名称"></el-table-column>
            <el-table-column prop="idNumber" label="设备编号"></el-table-column>
            <el-table-column prop="address" label="设备位置"></el-table-column>
            <el-table-column label="运行状态">
                <template slot-scope="scope">
                    {{scope.row.idNumberType==0?"在线":"离线"}}
                </template>
            </el-table-column> 
            <el-table-column width="170px" label="报警状态">
                <template slot-scope="status">
                    {{status.row.idNumberType==0?"正常":"非正常"}}
                </template>
            </el-table-column>
            <el-table-column label="操作" width="300px">
                <template>
                    <el-button size="mini">
                        控制</el-button>
                    <el-button size="mini">详情</el-button>
                </template>
            </el-table-column>
        </el-table>
        <paging @changePage='handleCurrentPage' :get-total='total'></paging>

    </section>
</template>
<script>
import paging from '../../components/paging';
export default {
    name: 'tree1',
    data() {
        return {
            total:0,
            data: [
                {
                    label: '防疫酒店',
                    children: [
                        {
                            label: '一栋',
                            children: [
                                {
                                    label: '一层',
                                },
                                {
                                    label: '二层',
                                },
                                {
                                    label: '三层',
                                },
                            ],
                        },
                    ],
                },
            ],
            defaultProps: {
                children: 'children',
                label: 'label',
            },
            value: '',
            value1: '',
            value2: '',
            formData: [
                {
                    name: '火灾报警',
                    idNumber: 123456,
                    address: '三栋-1层',
                    scope: 0,
                    status: 0,
                },
                {
                    name: '火灾报警',
                    idNumber: 123456,
                    address: '三栋-1层',
                    scope: 0,
                    status: 0,
                },
                {
                    name: '火灾报警',
                    idNumber: 123456,
                    address: '三栋-1层',
                    scope: 0,
                    status: 0,
                },
                {
                    name: '火灾报警',
                    idNumber: 123456,
                    address: '三栋-1层',
                    scope: 0,
                    status: 0,
                },
                {
                    name: '火灾报警',
                    idNumber: 123456,
                    address: '三栋-1层',
                    scope: 0,
                    status: 0,
                },
                {
                    name: '火灾报警',
                    idNumber: 123456,
                    address: '三栋-1层',
                    scope: 0,
                    status: 0,
                },
                {
                    name: '火灾报警',
                    idNumber: 123456,
                    address: '三栋-1层',
                    scope: 0,
                    status: 0,
                },
            ],
            multipleSelection: [],
            min: 0,
            nowName: '', //子集
            pName: '', //父级
            type: '',
            sortValue: '', //排序
            abbreviation: '', //简称
            description: '', //描述
            inputNumber: 0,
            checkStrictly: false, //控制子集和父级的关系
            changeHandle: 1, //1表示执行新增，0表示修改
            formSearch: {
                //查询条件
                name: '',
                status: 1,
            },
            parentType: '', //父级类型
            formPush: {
                sortValue: 0,
                // type:1,
                status: true,
            }, //表单提交

            defaultProps2: {
                //树状图key定义
                children: 'data',
                label: 'name',
            },
            parentId: '',
            menuList: [], //角色树
            showmenuList: [], //角色回显
            dataTree: [], //树数据
            filterText: '', //输入的查询内容
            rules: {
                parentId: [{ required: true, message: '该项不能为空' }],
                name: [{ required: true, message: '该项不能为空' }],
            },
            roles: [],
            delTree: [], //删除树
            number: 0,
        };
    },

    methods: {
        //页码改变
        handleCurrentPage(val) {
            this.formSearch.current = val;
            this.getList();
        },
        //树状图节点搜索
        filterNode(value, data) {
            if (!value) return true;
            return data.label.indexOf(value) !== -1;
        },
        getList() {},
    },
    mounted() {
        this.getList();
    },
    components: {
        paging,
    },
};
</script>
<style scoped lang='scss'>
.form_inline /deep/ .el-form-item {
    margin: 10px 4px;
}
</style>
